
from appium import webdriver

config = {
    "platformName": "Android",
    "deviceName": "127.0.0.0:62001",
    "platformVersion":"7.1.2",
    "appPackage": "com.gfeng.daydaycook",
    "appActivity": ".activity.TabActivity",
    "noReset": True
}
driver = webdriver.Remote("http://localhost:4723/wd/hub", config)

import time
import unittest
from BeautifulReport import BeautifulReport
from config.config import CASES_PATH,REPORT_PATH

# 定义时间格式
now = time.strftime('%Y%m%d%H%M%S')
# 定义文件名字
filename = 'test_crm_reslut-{}.html'.format(now)
# 通过discover方法找到需要执行的用例
suite = unittest.defaultTestLoader.discover(CASES_PATH,pattern='test_*.py')
# 使用BeautifulReport生成报告
runner = BeautifulReport(suite)
runner.report(description='日日煮测试报告',
              filename=filename,
              report_dir=REPORT_PATH)

